#ifndef TextField_H
#define TextField_H
#include "Node2D.h"
class TextField:public Node2D
{
public:
	TextField(void);
	~TextField(void);
	int getMaxLength(){return 4096;}
	int getTextSize();
	void clear();
	void insertChar( int nIndex, wchar_t wChar ); // Inserts the char at specified index. If nIndex == -1, insert to the end.
	void removeChar( int nIndex );  // Removes the char at specified index. If nIndex == -1, remove the last char.
	void insertString( int nIndex, const wchar_t* pStr, int nCount = -1 );  // Inserts the first nCount characters of the string pStr at specified index.  If nCount == -1, the entire string is inserted. If nIndex == -1, insert to the end.
	void setText( wchar_t* wszText );
	void getTextCopy(wchar_t**);
	void onCharacter(KeyEventArgs& e);
	void draw(SpriteBatch* spriteBatch);
private:
	std::wstring mTextBuffer;
};
#endif


